package com.sghd.pojo.fight.game;

import com.sghd.common.utils.json.JsonUtils;

import java.util.*;

/**
 * @author frank
 * @date 2018-10-30 14:29
 * @desc 技能报告
 **/
public class SkillReport {
    /** 施放者id*/
    private long id;
    /** 技能id*/
    private int skillId;
    /** 目标报告*/
    private List<TargetReport> reports = new ArrayList<>();
    private Map<ChessType, Integer> expends = new HashMap<>();
    private Map<ChessType, Integer> magics = new HashMap<>();
    private long date;
    /** 是否是死棋盘（需要重置）*/
    private boolean reset;
    private int round;
    private Set<Integer> indexs = new HashSet<>();

    public SkillReport() {
    }

    public SkillReport(long id, int skillId, Map<ChessType, Integer> expends, int round) {
        this.id = id;
        this.skillId = skillId;
        this.expends = new HashMap<>(expends);
        this.round = round;
    }

    public void addTarget(TargetReport targetReport) {
        this.reports.add(targetReport);
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public int getSkillId() {
        return skillId;
    }

    public void setSkillId(int skillId) {
        this.skillId = skillId;
    }

    public List<TargetReport> getReports() {
        return reports;
    }

    public void setReports(List<TargetReport> reports) {
        this.reports = reports;
    }

    public static void main(String[] args) {
        String s = "{\"id\":\"10000000\",\"skillId\":1000,\"reports\":[{\"target\":\"25\",\"source\":\"10000000\",\"state\":0,\"values\":[{\"type\":\"HP\",\"value\":-3}],\"buffs\":[],\"abs\":[{\"type\":\"HP\",\"value\":2147483644}],\"magics\":{}}],\"expends\":{\"CT_BLUE\":0},\"magics\":{\"CT_BLUE\":0,\"CT_PURPLE\":0,\"CT_YELLOW\":0,\"CT_GREEN\":0,\"CT_RED\":0},\"date\":\"1548397327380\",\"reset\":false,\"round\":0,\"indexs\":[]}";
        SkillReport report = JsonUtils.string2Object(s, SkillReport.class);
        System.out.println(report.getId());
    }

    public Map<ChessType, Integer> getMagics() {
        return magics;
    }

    public void setMagics(Map<ChessType, Integer> magics) {
        this.magics = magics;
    }

    public Map<ChessType, Integer> getExpends() {
        return expends;
    }

    public void setExpends(Map<ChessType, Integer> expends) {
        this.expends = expends;
    }

    public long getDate() {
        return date;
    }

    public void setDate(long date) {
        this.date = date;
    }

    public boolean isReset() {
        return reset;
    }

    public SkillReport setReset(boolean reset) {
        this.reset = reset;
        return this;
    }

    public int getRound() {
        return round;
    }

    public void setRound(int round) {
        this.round = round;
    }

    public Set<Integer> getIndexs() {
        return indexs;
    }

    public void setIndexs(Set<Integer> indexs) {
        this.indexs = indexs;
    }

}
